package me.exchange.com.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.amazonaws.services.dynamodbv2.xspec.B;
import com.amazonaws.services.dynamodbv2.xspec.N;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Columns;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * @author zhaojing
 * @create2020/5/23
 */
@Entity
@Getter
@Setter
@Table(name = "sys_scroll")
@org.hibernate.annotations.Table(appliesTo = "sys_scroll",comment = "滚动图图片管理")
public class Scroll {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(name = "id",value = "ID",required = false)
    private Long id;

    /** 描述*/
    @Column(name = "represent")
    @ApiModelProperty(name = "represent",value = "描述",required = false)
    private String represent;

    /** 地址*/
    @Column(name = "adress")
    @ApiModelProperty(name = "adress",value = "地址",required = false)
    private String adress;

    /** 上线时间*/
    @Column(name = "on_time")
    @ApiModelProperty(name = "onTime",value = "上线时间",required = false)
    private Timestamp onTime;

    /** 下线时间*/
    @Column(name = "off_time")
    @ApiModelProperty(name = "offTime",value = "下线时间",required = false)
    private Timestamp offTime;

    /** 状态*/
    @Column(name = "enabled")
    @ApiModelProperty(name = "enabled",value = "状态",required = false)
    private Boolean enabled;

    /** 创建人*/
    @Column(name = "c_admin_id")
    @ApiModelProperty(name = "cAdminId",value = "创建人",required = false)
    private Long cAdminId;

    /** 创建时间*/
    @Column(name = "c_admin_time")
    @ApiModelProperty(name = "cAdminTime",value = "创建时间",required = false)
    private Timestamp cAdminTime;

    /** 修改人*/
    @Column(name = "u_admin_id")
    @ApiModelProperty(name = "uAdminId",value = "修改人",required = false)
    private Long uAdminId;

    /** 修改时间*/
    @Column(name = "u_admin_time")
    private Timestamp uAdminTime;

    /** 是否删除 0未删除 1删除*/
    @Column(name = "isdel")
    @ApiModelProperty(name = "isdel",value = "是否删除",required = false)
    private Boolean isdel;

    /** 排序*/
    @Column(name = "sort")
    @ApiModelProperty(name = "sort",value = "排序",required = false)
    private Long sort;

    /** 上传*/
    @Column(name = "upload")
    @ApiModelProperty(name = "upload",value = "上传",required = false)
    private String upload;

    /** 名称*/
    @Column(name = "scroll_name")
    @ApiModelProperty(name = "scrollName",value = "名称",required = false)
    private String scrollName;


    public void copy(Scroll source) {
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
